/*
 * Copyright 2016 Wealth Inc. All rights reserved.
 */
 package com.wealth.member.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import com.wealth.member.entity.Membership;
import com.wealth.member.repository.MembershipDao;
import com.wealth.member.service.IMembershipService;

import iaas.service.impl.BaseServiceImpl;

/**
 * @author chan
 */
 @Component
public class MembershipServiceImpl extends BaseServiceImpl<Membership> implements IMembershipService{

	@Autowired
	private MembershipDao membershipDao;

	 /** 查询会员身份 */
	@Override
	public Membership getMemberShipByMemberIdAndCorpId(Long memberid, Long corpid) {
		return membershipDao.findByMemberIdAndCorpId(memberid, corpid);
	}
	
	 /** 查询会员身份 微信号+企业 */
	 public Membership getMemberShipByOpenidAndCorpId(String openid,Long corpid){
		 return membershipDao.findByOpenidAndCorpId(openid, corpid);
	 }
	 
	 /** 查询一个企业下的所有会员身份 企业 */
	 public List<Membership> getMemberShipByCorpId(Long corpid){
		 return membershipDao.findByCorpId(corpid);
	 }
	
	


}


